package com.mocha.test.controller;

import com.mocha.test.service.DemoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class DemoController {
    Logger logger = LoggerFactory.getLogger(DemoController.class);

    @Autowired
    private DemoService testService;

    @RequestMapping(value = "/test", method = {RequestMethod.POST,RequestMethod.GET})
    public String test(String test){
        logger.info("test controller");
        return testService.test(test);
    }

}
